
import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main, sim_items
from util import *

class Potion(sim_items.Potion):
    def __init__(self):
        sim_items.Potion.__init__(self, "perception", "!",
                ('see', 'more'),
                idDescription="Made from the extract of diviner's sage, "\
                    "consuming this potion temporarily "\
                    "enhances one's powers of observation. Excessive use "\
                    "may have various readily apparent side effects.")

    def quaff(self, quaffer):
        self.amount = random.randint(9,11)
        self.duration = 30000

        main.schedule(sim.Event('increase stat', main.schedule.time, (quaffer,
            'perceptionMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('decrease stat', main.schedule.time +\
            self.duration, (quaffer, 'perceptionMod', self.amount), dests=[quaffer]))
        main.schedule(sim.Event('statusNote+', main.schedule.time, (quaffer,
            'percep'), dests=[quaffer]))
        main.schedule(sim.Event('statusNote-', main.schedule.time +\
            self.duration, (quaffer, 'percep'), dests=[quaffer]))
        quaffer.identify(self)

#========================================
thingClass = Potion




